# RUN: tf_tfl_translate -tf-input-arrays=input0,input1 -tf-input-shapes=4:4 -tf-input-data-types=DT_INT32,DT_INT32 -tf-output-arrays=Add %s -o - | flatbuffer_to_string - | FileCheck %s

# Add two tensor<4xi32> inputs and return the result

node {
  name: "Add"
  op: "Add"
  input: "input0"
  input: "input1"
  attr {
    key: "T"
    value {
      type: DT_INT32
    }
  }
}
node {
  name: "input0"
  op: "Placeholder"
  attr {
    key: "dtype"
    value {
      type: DT_INT32
    }
  }
}
node {
  name: "input1"
  op: "Placeholder"
  attr {
    key: "dtype"
    value {
      type: DT_INT32
    }
  }
}
versions {
  producer: 27
}

# CHECK:      {
# CHECK-NEXT:   version: 3,
# CHECK-NEXT:   operator_codes: [ {
# CHECK-NEXT:     version: 1
# CHECK-NEXT:   } ],
# CHECK-NEXT:   subgraphs: [ {
# CHECK-NEXT:     tensors: [ {
# CHECK-NEXT:       shape: [ 4 ],
# CHECK-NEXT:       type: INT32,
# CHECK-NEXT:       buffer: 1,
# CHECK-NEXT:       name: "input0",
# CHECK-NEXT:       quantization: {
# CHECK-EMPTY:
# CHECK-NEXT:       },
# CHECK-NEXT:       has_rank: true
# CHECK-NEXT:     }, {
# CHECK-NEXT:       shape: [ 4 ],
# CHECK-NEXT:       type: INT32,
# CHECK-NEXT:       buffer: 2,
# CHECK-NEXT:       name: "input1",
# CHECK-NEXT:       quantization: {
# CHECK-EMPTY:
# CHECK-NEXT:       },
# CHECK-NEXT:       has_rank: true
# CHECK-NEXT:     }, {
# CHECK-NEXT:       shape: [ 4 ],
# CHECK-NEXT:       type: INT32,
# CHECK-NEXT:       buffer: 3,
# CHECK-NEXT:       name: "Add",
# CHECK-NEXT:       quantization: {
# CHECK-EMPTY:
# CHECK-NEXT:       },
# CHECK-NEXT:       has_rank: true
# CHECK-NEXT:     } ],
# CHECK-NEXT:     inputs: [ 0, 1 ],
# CHECK-NEXT:     outputs: [ 2 ],
# CHECK-NEXT:     operators: [ {
# CHECK-NEXT:       inputs: [ 0, 1 ],
# CHECK-NEXT:       outputs: [ 2 ],
# CHECK-NEXT:       builtin_options_type: AddOptions,
# CHECK-NEXT:       builtin_options: {
# CHECK-EMPTY:
# CHECK-NEXT:       }
# CHECK-NEXT:     } ]
# CHECK-NEXT:   name: "main"
# CHECK-NEXT:   } ],
# CHECK-NEXT:   description: "MLIR Converted.",
# CHECK-NEXT:   buffers: [ {
# CHECK-EMPTY:
# CHECK-NEXT:   }, {
# CHECK-EMPTY:
# CHECK-NEXT:   }, {
# CHECK-EMPTY:
# CHECK-NEXT:   }, {
# CHECK-EMPTY:
# CHECK-NEXT:   }, {
# CHECK-NEXT:     data: [ 49, 46, 53, 46, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
# CHECK-NEXT:   } ],
# CHECK-NEXT:   metadata: [ {
# CHECK-NEXT:   name: "min_runtime_version",
# CHECK-NEXT:   buffer: 4
# CHECK-NEXT:   } ],
# CHECK-NEXT:   signature_defs: [ ]
# CHECK-NEXT: }
